﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for UserAccountBlo
/// </summary>
public class UserAccountBlo
{
    #region "variable"
    private UserAccountDao dao;
    private string _error;
    private UserAccountDto dto;
    #endregion
     
    #region "properties"
    public string Error
    {
        get { return _error; }
        set { _error = value; }
    }


    public UserAccountDto Service
    {
        get { return dto; }
        set { dto = value; }
    }
    #endregion
	public UserAccountBlo()
	{
        dao = new UserAccountDao();
        dto = new UserAccountDto();
	}
    public void DeleteUserAccount(int id_UA)
    {
        MobileBlo _mobileBlo=new MobileBlo();
        List<MobileDto> _listMobile =_mobileBlo.SelectMobileByID_UA(id_UA);
        foreach (MobileDto _mobile in _listMobile)
        {
            _mobileBlo.DeleteMobileNumber(_mobile.Id_MN);
        }
        dao.DeleteUserAccount(id_UA);
    }
    public void UpdateUserAccount(UserAccountDto _userAccountDto)
    {
        dao.UpdateUserAccount(_userAccountDto);
    }
    public List<UserAccountDto> SelectUserAccountBy(string _searchColumn,string _searchString)
    {
        return dao.SelectUserAccountBy(_searchColumn, _searchString);
    }
}